all:
	cd src && make && cd ..
	make install
	make test
	
clean:
	cd src && make clean  && cd ..
	rm -r isofiles
	rm image.iso

install:
	mkdir isofiles
	mkdir isofiles/boot/
	mkdir isofiles/boot/grub/
	cp grub/stage2_eltorito isofiles/boot/grub
	cp src/kernel/kernel isofiles/
	cp src/menu.lst isofiles/boot/grub


	mkdir isofiles/bin
	cp src/app/test/test isofiles/bin
	

	mkdir isofiles/lib
	cp src/lib/posix/libc.a isofiles/lib
	cp src/lib/system/libsystem.a isofiles/lib
	
	
	mkdir isofiles/include
	mkdir isofiles/include/libc
	mkdir isofiles/include/system
	cp src/lib/libc/*.h isofiles/include/libc
	cp src/lib/system/*.h isofiles/include/system

	mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso isofiles

	rm -r isofiles


test:
	bochs -f bochs.rc 

src:
	cd src && make && cd ..
